﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using System.Xml;
using System.ServiceModel.Channels;
using System.Reflection;

namespace AAA.Communication.WCFService
{
    // NOTE: If you change the class name "CrossDomainService" here, you must also update the reference to "CrossDomainService" in App.config.
    public class CrossDomainService : ICrossDomainService
    {
        public System.ServiceModel.Channels.Message ProvidePolicyFile()
        {
            // Either specify ClientAcessPolicy.xml file path properly
            // or put that in \Bin folder of the console application
            XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("AAA.Communication.WCFService.ClientAccessPolicy.xml"));
            System.ServiceModel.Channels.Message result = Message.CreateMessage(MessageVersion.None, "", reader);
            return result;

        }
    }
}
